package com.yhsimon.feign;


import com.yhsimon.entity.Order;
import com.yhsimon.entity.OrderVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;


@FeignClient("order")
public interface OrderFeign {

    @GetMapping("/order/findAllByUId/{uid}/{index}/{limit}")
    public OrderVO findAllByUId(@PathVariable("uid") int uid, @PathVariable("index") int index, @PathVariable("limit") int limit);

    @PostMapping("/order/save")
    void save(@RequestBody Order order);

    @GetMapping("/order/findAllByState/{index}/{limit}")
    OrderVO findAllByState(@PathVariable("index") int index, @PathVariable("limit") int limit);


    @PutMapping("/order/updateState/{id}/{state}/{aid}")
    void updateState(@PathVariable("id") int id, @PathVariable("state") int state, @PathVariable("aid") int aid);

    @GetMapping("/order/findAll/{index}/{limit}")
    OrderVO findAll(@PathVariable("index") int index,@PathVariable("limit") int limit);

    @DeleteMapping("/order/deleteById/{id}")
    void deleteById(@PathVariable("id") int id);

}
